//1.导包
import VueRouter from 'vue-router'



// 导入 Account 组件
import account from './main/Account.vue'
import goodslist from './main/GoodsList.vue'
import dept from './main/Dept.vue'
//导入子组件
import login from './subcom/login.vue'
import register from './subcom/register.vue'

// 3. 创建路由对象
var router = new VueRouter({
  routes: [
    // account  goodslist
    { 
			path: '/account', 
			component: account ,
			//子路由
			children:[
				//子组件
				{path: 'login',component: login },
				{path: 'register',component: register }
			]
		},
		{ path: '/goodslist', 
			component: goodslist 
		},
		{
			path: '/dept',
			component: dept
		}
  ]
})

//把路由对象暴露出去
export default router